import { _decorator, Component, EventTouch, Input, instantiate, Label, Node, UITransform, Vec2, Vec3 } from 'cc';
import { AssetList, Direction, Global } from '../Global';
import { UIMgr } from '../Mgr/UIMgr';
import { AudioMgr, SoundName } from '../Mgr/AudioMgr';
import { GameSet } from '../Pop/GameSet';
import { GAMEDATA } from './GAMEDATA';
import { GameEnd } from '../Pop/GameEnd';
import { LocalStorageMgr } from '../Mgr/LocalStorageMgr';
import { TopPrompt } from '../Top/TopPrompt';
const { ccclass, property } = _decorator;

@ccclass('GameScene')
/**
 * 游戏场景
 */
export class GameScene extends Component {

    //
    static Instance: GameScene = null;

    protected onLoad(): void {
        GameScene.Instance = this;
        Global.IsEnd = false;
    }


    protected start(): void {

    }

    /**
    * 点击设置
    */
    private SetClick() {
        AudioMgr.instance.PlayEffect(SoundName.Click);
        let set: Node = UIMgr.Instance.ShowPop(AssetList.Pop.GAMESET);
        set.getComponent(GameSet).Init(false);
    }

   

    /**
     * 游戏结束
     */
    public GameOver() {
        Global.IsEnd = true;

        let gs: Node = UIMgr.Instance.ShowPop(AssetList.Pop.GAMEEND);
        gs.getComponent(GameEnd).UpdateScore();
    }

    
}


